#ifndef A6_PRINTER_H
#define A6_PRINTER_H

#include <uC++.h>
#include <vector>

_Monitor Printer 
{
public:
	enum Kind { Parent, 
				WATCardOffice, 
				NameServer, 
				Truck, 
				BottlingPlant, 
				Student, 
				Vending, 
				Courier 
			   };
private:
	struct StateInfo
	{
		char	state;
		int		info1;
		int 	info2;

		StateInfo() { reset(); };
		void reset() { state = '*'; info1 = -1; info2 = -1; };
	};
	
	std::vector<StateInfo> myStateBuffer;

    unsigned int myNumStudents;
    unsigned int myNumVendingMachines;
    unsigned int myNumCouriers;

	unsigned int myStudentStartingPos;
	unsigned int myVMStartingPos;
	unsigned int myCourierStartingPos;
	
	unsigned int getBufferPos(Kind kind, int lid);
	void	dumpBuffer();
	
public:
	~Printer();

	Printer( unsigned int numStudents, unsigned int numVendingMachines, unsigned int numCouriers );
	void print( Kind kind, char state );
	void print( Kind kind, char state, int value1 );
	void print( Kind kind, char state, int value1, int value2 );
	void print( Kind kind, unsigned int lid, char state );
	void print( Kind kind, unsigned int lid, char state, int value1 );
	void print( Kind kind, unsigned int lid, char state, int value1, int value2 );
};

#endif
